<?php


namespace app\common\model;


class CourseOrderDetail extends BaseModel
{

    protected $name = "course_order_detail";

    public static function detail($where,$with=[]){

        return static::get($where,$with);
    }

    public function file()
    {
        return $this->belongsTo('UploadFile', 'image_id', 'file_id')
            ->bind(['file_path', 'file_name', 'file_url']);
    }

    public function reservation(){
        return $this->hasMany("app\\common\\model\\Reservation",'course_order_id','course_order_id');
    }
}